package com.example.a2032.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import com.example.a2032.db.DataDbHelper;
import com.example.a2032.db.dao.DeviceInfoDao;
import com.example.a2032.entity.DeviceInfo;

public class DeviceInfoViewModel extends AndroidViewModel {
    MutableLiveData<String> mutableLiveData = new MutableLiveData<>();
    DeviceInfoDao deviceInfoDao;

    public DeviceInfoViewModel(@NonNull Application application) {
        super(application);
        deviceInfoDao = DataDbHelper.getInstance(application).getDeviceInfoDao();
    }

    public MutableLiveData<String> getMutableLiveData() {
        return mutableLiveData;
    }

    public LiveData<DeviceInfo> getDeviceInfo(){
        return  deviceInfoDao.loadAllDeviceInfo();
    }
}
